﻿using ProtoBuf;
using System;
using System.Text;

namespace ToyChat.BuiltinModules
{
    /// <summary>
    /// A basic messaging class
    /// </summary>
    [ProtoContract]
    public class BasicMessage
    {
        /// <summary>
        /// Gets or Sets the message
        /// </summary>
        [ProtoMember(1)]
        public string UTF8Message
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or Sets a string describing the data type of this message (Not required)
        /// </summary>
        [ProtoMember(2, IsRequired = false)]
        public string DataType
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or Sets the colour of this message
        /// </summary>
        [ProtoMember(3, IsRequired = false)]
        public Colour Colour
        {
            get;
            set;
        }
    }

    /// <summary>
    /// This class is used to transfer message colours
    /// </summary>
    [ProtoContract(Name = "Core.ColorMessage")]
    public class Colour
    {
        /// <summary>
        /// Gets or Sets the Red channel value of the colour
        /// </summary>
        [ProtoMember(1, IsRequired = true)]
        public byte R { get; set; }

        /// <summary>
        /// Gets or Sets the Green channel value of the colour
        /// </summary>
        [ProtoMember(2, IsRequired = true)]
        public byte G { get; set; }

        /// <summary>
        /// Gets or Sets the Blue channel value of the colour
        /// </summary>
        [ProtoMember(3, IsRequired = true)]
        public byte B { get; set; }
    }
}